<template>
  <div id="app">
    <el-container class="main-layout">
      <el-header height="56px" class="header-bar">
        <h1>Hello</h1>
      </el-header>
      <el-container class="main-container">
        <el-aside width="220px" class="aside-menu">
          <CommonAside @update-content="updateContent" />
        </el-aside>
        <el-main class="main-content">
          <UserList v-if="currentContent === '1'" />
          <div v-else-if="currentContent === '2'">系统设置内容</div>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import UserList from './components/UserList.vue'
import CommonAside from './components/CommonAside.vue'
import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'

export default {
  name: 'App',
  components: {
    UserList,
    CommonAside,
    ElBreadcrumb,
    ElBreadcrumbItem
  },
  data() {
    return {
      currentContent: '1',
      breadcrumbName: '用户管理'
    }
  },
  methods: {
    updateContent(key) {
      this.currentContent = key
      // 更新面包屑名称
      if (key === '1') {
        this.breadcrumbName = '用户管理'
      } else if (key === '2') {
        this.breadcrumbName = '系统设置'
      }
    },

  },

  computed: {
  }
}
</script>

<style>
#app {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  height: 100vh;
}

.main-layout {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f5f7fa;
}

.main-container {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.aside-menu {
  background: #ffffff;
  color: #333;
  box-shadow: 2px 0 8px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border-right: 1px solid #e6e6e6;
}

.header-bar {
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 24px;
  font-size: 20px;
  font-weight: 600;
  color: #333;
  height: 56px;
  border-bottom: 1px solid #e6e6e6;
}

.main-content {
  background: #f5f7fa;
  padding: 20px;
  flex: 1;
  overflow-y: hidden;
  height: calc(100vh - 56px);
}

.breadcrumb {
  padding: 12px 24px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  margin-bottom: 16px;
  border-radius: 8px;
  font-weight: 500;
  border: 1px solid #e6e6e6;
}

/* 滚动条样式优化 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(144, 147, 153, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-track {
  background-color: rgba(0, 0, 0, 0.05);
}


</style>